Skip to content
  • qml loader male memory leak!

    Unsolved QML and Qt Quick qml loader memory leak c++ qt5.9.2
    2
    0 Votes
    2 Posts
    1k Views
    dheerendraD
    Just by loading one page and coming back, we can't make out the memory leak. Try multiple times like this. If you see a increase & no decrease then we can conclude memory leak. If you can send me the complete example, we can try as well.
  • Reuse a QGraphicsScene causes memory leak

    Unsolved General and Desktop qgraphicsscene memory leak
    2
    0 Votes
    2 Posts
    822 Views
    JKSHJ
    Hi @wthung, I don't think this forum supports file uploads. Can you create a simple example that demonstrates the memory leak? Just post the code here, no need to upload an attachment.
  • 0 Votes
    10 Posts
    4k Views
    SGaistS
    Like I already wrote, it has nothing to do with Qt. Qt is a C++ framework, it doesn't do anything special with respect to memory management. So yes, since the OP wrote that the memory was not freed after the application ended then he needs to elaborate on that.
  • QtJambi memory leak

    Moved Unsolved Language Bindings qt jambi memory leak java
    2
    0 Votes
    2 Posts
    1k Views
    SGaistS
    Hi and welcome to devnet, That version of QtJambi is not part of Qt. In fact QtJambi has been deprecated a long time ago and the version you are using is a community edition. You should ask the authors of it directly.
  • 0 Votes
    6 Posts
    3k Views
    mrjjM
    @Stefan-Monov76 The automatic deletion of QObject childs by the parents is used in whole Qt frame work and is fully documented and will not change in any version. http://doc.qt.io/qt-5/objecttrees.html
  • 0 Votes
    3 Posts
    3k Views
    ErikaE
    Thanks Wieland for taking a look. And thanks for the mailing list suggestion! Good to know of more Qt resources. I've filed a bug: https://bugreports.qt.io/browse/QTBUG-56774
  • 0 Votes
    3 Posts
    2k Views
    flyingdragonF
    @Wieland No, we are using the <video> tag in HTML5, together with JS to play webM format video. With 5.6, the video goes up all the time till the system crashes. The problem is disappeared in 5.7 with newer Chromium core, but it leads out a new problem as indicated the https://bugreports.qt.io/browse/QTBUG-53411. When we use 5.7, the memory is fairly stable, but then after the first run, the JS will fail to work with the application due to a bug in QwebchannelTransport. We tried to build QT from source code, but the WebEngine won't build (see my other post). We are looking for a compiled WebEngine module with the bugs fixed as indicated in the QTBug-53411. Thank you.
  • Need help to build WebEngine module

    Unsolved QtWebEngine 5.7.0 webchannel webengine webm memory leak
    1
    0 Votes
    1 Posts
    965 Views
    No one has replied
  • 0 Votes
    3 Posts
    2k Views
    Vlad_SavelyevV
    sure i will reply with the project code
  • QList<QObject*> and Memory Leak Issue

    Solved General and Desktop memory leak qlist qobject pointer
    15
    0 Votes
    15 Posts
    16k Views
    DongD
    @kshegunov There is a reason why I can't use QT Property Binding (It only support predefined Property using Q_PROPERTY script). Please take a look at my topic about Auto Binding 2 ways with Dynamic Property But Binding is an other topic. About "Object's pointers & Memory" I also take an advise from a Pro in C++ & memory management. His solution is implement a Factory Pattern to Create/Delete Object's pointers (also free memory when an instance had no pointer to it.) (I think I'll give it a try)
  • Unexpected Memory Leak in Windows 10?

    Unsolved General and Desktop memory leak qudpsocket windows 10
    7
    0 Votes
    7 Posts
    4k Views
    kshegunovK
    @AnnaB There's one thing bothering me though ... You said you can't afford to drop a frame, but you use datagrams, which are inherently unsafe (in that manner) ... otherwise I'd assume it's what @SGaist said - probably your processing is lagging behind and there's work queuing up ...
  • Trying to fix memory leak due to QGraphicsScene

    Unsolved General and Desktop qt 5.5.1 c++ memory leak
    13
    0 Votes
    13 Posts
    8k Views
    A
    @Akito_Kami Your "load" function instantiates a new QGraphicsScene You call it within a loop. Therefore you instantiate multiple QGraphicsScenes I don't see where you need to do that. Also, I wrote "QGraphicsItem-derived", not "QGraphicsItem". If you want to show pixmaps, use QGraphicsPixmapItem, or implement your own version of QGraphicsItem to show a pixmap. Totally unrelated: I hate my junk mail filter. Otherwise I would have answered sooner.
  • Qml/C++ Memory Leak?

    Unsolved General and Desktop qml c++ qt5.5 memory leak memory managmen
    8
    0 Votes
    8 Posts
    5k Views
    A
    @SGaist ok, is one of my last options (the other is make the post petitions and processing in other thread).
  • corrupted double-linked list

    Unsolved General and Desktop memory leak error
    2
    0 Votes
    2 Posts
    2k Views
    F
    pushbutton delete . new pushbutton create . Resolved. I do not know why the error has occurred. also I do not know why the Resolved.
  • 0 Votes
    5 Posts
    3k Views
    F
    @jsulm I was mistaken. should have checked the Definitely logs.
  • QML FileDialog memory leak

    QML and Qt Quick qml filedialog memory leak
    3
    1 Votes
    3 Posts
    2k Views
    ?
    Hi! Looks like this isn't in the bug tracker yet. Please report it to bugreports.qt.io.
  • 0 Votes
    3 Posts
    3k Views
    S
    It's a mistake when I copy the code from other place. Here are the exact code below that I just write for this network test. The bigger the count of request sent in a loop, the more consumed virtual memory of this program. And after finished all of these http requests, the Virtual Memory of this program did not reduce. However, when I add a qWait(1) between every request, the memory will not goes up when the number of sent requests grows. But the memory still doesn't go down when I delete everything I used to access network. It seems when concurrently create and send a large amount of http requests through QNetworkAccessManager, the memory leakage will happen. //Header** #ifndef NETWORK_H #define NETWORK_H #include <QObject> #include <QNetworkAccessManager> #include <QNetworkRequest> #include <QNetworkReply> #include <QUrl> #include <QTest> class NetWork : public QObject { Q_OBJECT private: explicit NetWork(QObject *parent = 0); public: static NetWork *Instance(); void Post(const QUrl &url, const QByteArray content); void Get(const QUrl &url); void Clean(); void Print(); QNetworkAccessManager *Manager(); signals: public slots: void SlotPostFinished(); void SlotCountDestroyed(); private: static NetWork *_network; QNetworkAccessManager *_manager; public: qint32 _countOk, _countError, _countSent, _countDestroyed; }; class UnitTest_Network : public QObject{ Q_OBJECT public: explicit UnitTest_Network(QObject *parent = 0); private slots: void test10ps(); void test10ps_data(); }; #endif // NETWORK_H //CPP #include "network.h" NetWork::NetWork(QObject *parent) : QObject(parent) { _manager = new QNetworkAccessManager(this); } NetWork *NetWork::_network = NULL; NetWork *NetWork::Instance() { if(_network == NULL){ _network = new NetWork(); } return _network; } void NetWork::Post(const QUrl &url, const QByteArray content) { QNetworkRequest request(url); request.setRawHeader("Content-Type", "application/json"); QNetworkReply *reply = _manager->post(request, content); connect(reply, SIGNAL(finished()), this, SLOT(SlotPostFinished())); connect(reply, SIGNAL(destroyed()), this, SLOT(SlotCountDestroyed())); } void NetWork::Get(const QUrl &url) { QNetworkRequest request(url); request.setRawHeader("Content-Type", "application/json"); QNetworkReply *reply = _manager->get(request); connect(reply, SIGNAL(finished()), this, SLOT(SlotPostFinished()), Qt::DirectConnection); connect(reply, SIGNAL(destroyed()), this, SLOT(SlotCountDestroyed())); } void NetWork::Clean() { _countOk = 0; _countError = 0; _countSent = 0; _countDestroyed = 0; } void NetWork::Print() { qDebug("10 ps:\t Sent = %d, Ok = %d, Error = %d, Destroyed = %d", _countSent, _countOk, _countError, _countDestroyed); qApp->processEvents(); } QNetworkAccessManager *NetWork::Manager() { return _manager; } void NetWork::SlotPostFinished() { QNetworkReply reply = (QNetworkReply)sender(); qint32 statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); if(!reply->error()){ _countOk++; } else{ _countError++; } reply->readAll(); reply->abort(); reply->close(); reply->deleteLater(); } void NetWork::SlotCountDestroyed() { _countDestroyed++; } void UnitTest_Network::test10ps() { } void UnitTest_Network::test10ps_data() { QTest::addColumn<qint32>("hehe"); NetWork::Instance()->Clean(); qDebug("Test 10 ps ..."); qint32 count = 500; qDebug("Starting ..."); QTest::qWait(1000); for(int j=0; j<10; j++){ for(int i=0; i<count; i++){ NetWork::Instance()->Post(QString("http://192.168.0.90/rest/Logs/"), QByteArray("{\"reserve\" : \"\", \"logTime\" : 1410865245827, \"machineId\" : \"0023\", \"operationCode\" : \"x\", \"deviceNum\" : \"b\", \"deviceAttribute\" : \"5\",\"parameter\" :\"0624\", \"checksum\" : -111, \"serialNum\" : \"92bb\"}")); NetWork::Instance()->_countSent++; // QTest::qWait(1); // qApp->processEvents(); } qDebug("LOOP No.%d", j); } while(1){ if(NetWork::Instance()->_countSent == NetWork::Instance()->_countError + NetWork::Instance()->_countOk) break; NetWork::Instance()->Print(); QTest::qWait(5000); } qDebug("delete manager ..."); QTest::qWait(5000); NetWork::Instance()->Manager()->deleteLater(); qDebug("wait ..."); QTest::qWait(5000); qDebug("delete network ..."); NetWork::Instance()->deleteLater(); QTest::qWait(5000); qDebug("End ..."); QTest::qWait(10000); } UnitTest_Network::UnitTest_Network(QObject *parent) { } QTEST_MAIN(UnitTest_Network)
  • 0 Votes
    2 Posts
    6k Views
    B
    Solved thank to the help of inz on IRC. I've added the line gc() just after the line canvas.imageData = ctx.getImageData(0, 0, canvas.width, canvas.height) // this causes a memory leak And the memleak disappeared. Seems like the automatic garbage collector didn't run often enough for my use case, so the call to gc() is necessary to force the garbage collection.
  • 0 Votes
    4 Posts
    8k Views
    L
    Hello, Few issues with Your code: QThread constructor moveToThread( this); is error. QThread class is just control object and is not actually a separate thread. You should move class base on QObject (with would be wrapper for QTcpSocket communication) or QTcpSocket to separate thread. 2.. Don't know if this is Ui application but You are using blocking approach (may be ok for Your case) Error handing : connect (QTcpSocket, SIGNAL( error(QAbstractSocket::SocketError socketError)), this, SLOT( error(QAbstractSocket::SocketError socketError))); to handle connection error. Close socket via QTcpSocket::close() or abort() + close()
  • [SOLVED] memory leak QListView

    General and Desktop memory leak
    8
    0 Votes
    8 Posts
    3k Views
    SGaistS
    Indeed, that part can be a bit tricky at beginning :) Glad you found out ! Happy coding !